Allow user to override tile level calculation#1566
Conversation
|
Thinking about it a bit more, there might be an issue with returning false from Anyway it looks like a bit hacky to be able to return null from |
|
Thanks for looking into this -
I think it's okay for us to limit the return value of "mapZoomLevelToTile" (and therefore "calculateLevel") to numbers. Then a user can just return -1 to indicate "no content".
I don't think I'm quite following this. "hasContent" should just indicate whether there are any image tiles in the given overlay that cover the range associated with a tile. If it returns "false" then no render target is created for that layer (since there will be nothing to write to it) but this won't impact the refinement of the 3d tile geometry.
Returning false should be fine for a case like this but if we limit the return values to numbers then it would just look like this: layer.mapZoomLevelToTile = level => {
return level >= 16 ? level : - 1;
};-- Thinking ahead a little bit, as well - one improvement I would like to make at some point is scaling the resolution of the texture based on world-scale size of the geometry. I don't think that impacts this for now, though? |
Following discussion in #1278.
In this proposal,
calculateLevelcan now returnnull. This user-override indicates that the current tile has no content and should not be rendered. Let me know what you think about it. An alternative would be to supportminLevelandmaxLevelonTiledImageOverlay. In that case, we might want to clamplevelbetweenminLevelandmaxLevelincalculateLevel, even though after testing it I noticed that the rest of the codebase is already clampingleveleverywhere I checked.